/*
 * Copyright (c) 2020, QST Innovation Technology Group Co.,Ltd and/or its affiliates. All rights reserved.
 * QST Innovation Technology Group Co.,Ltd PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.example.exporttemplate.controller;

import com.alibaba.fastjson2.JSON;
import com.example.exporttemplate.domain.Chapter;
import com.example.exporttemplate.domain.POST;
import org.springframework.util.MultiValueMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 测试validated注解控制器
 *
 * @author liulindong
 * @since 2023/1/5 16:23
 */
public class TestValidatedController {


    @PostMapping("/insertChapter")
    public void addChapter(@RequestBody @Validated(POST.class) List<Chapter> chapters) {
        System.out.println(JSON.toJSON(chapters));
    }
}
